package com.zego.wawaji.ui.center.wawa;

import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.zego.wawaji.R;
import com.zego.wawaji.ui.dialog.popup.BottomPopup;

/**
 * 娃娃兑换娃娃币成功弹框
 * Created by Su on 2017/12/6.
 */
public class WawaExchangeDialog extends BottomPopup {
    private int awardNum;   // 兑换娃娃币数量

    public WawaExchangeDialog(FragmentActivity activity) {
        super(activity);
        setCancelableOutTouch(false);
    }

    @Override
    protected View makeContentView() {
        View inflate = LayoutInflater.from(activity).inflate(R.layout.wawa_exchange_dialog, null);
        TextView tv_award = (TextView) inflate.findViewById(R.id.tv_award);

        tv_award.setText("+" + awardNum);
        inflate.findViewById(R.id.btn_close).setOnClickListener(v -> dismiss());
        return inflate;
    }

    /**
     * 设置娃娃币数量
     */
    public void setAwardNum(int awardNum) {
        this.awardNum = awardNum;
    }
}
